import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '工艺名称',
    align: "center",
    dataIndex: 'craftName',
    width: 110
  },
  {
    title: '萃取次数设置',
    align: "center",
    dataIndex: 'leachTs',
    width: 70
  },
  {
    title: '计量设定时间(s)',
    align: "center",
    dataIndex: 'meterSt',
    width: 80
  },
  {
    title: '计量延迟时间(s)',
    align: "center",
    dataIndex: 'meterDt',
    width: 80
  },
  {
    title: '萃取进液设定时间(s)',
    align: "center",
    dataIndex: 'intakeSt',
    width: 90
  },
  {
    title: '萃取出液设定时间(s)',
    align: "center",
    dataIndex: 'leachSt',
    width: 90
  },
  {
    title: '萃取出液延迟蒸发时间(s)',
    align: "center",
    dataIndex: 'vapDt',
    width: 105
  },
  {
    title: '浸泡设定时间(s)',
    align: "center",
    dataIndex: 'dipinSt',
    width: 80
  },
  {
    title: '延迟时间设置(s)',
    align: "center",
    dataIndex: 'delaySt',
    width: 80
  },
  {
    title: '真空计量时间设置(s)',
    align: "center",
    dataIndex: 'vacuoMst',
    width: 90
  },
  {
    title: '真空压力设置(kPa)',
    align: "center",
    dataIndex: 'vacuoPre',
    width: 90
  },
  {
    title: '压机压力设置(kPa)',
    align: "center",
    dataIndex: 'comprPre',
    width: 80
  },
  {
    title: '热水温度设置(℃)',
    align: "center",
    dataIndex: 'hwaterTem',
    width: 85
  },
  {
    title: '热水温度预减1(℃)',
    align: "center",
    dataIndex: 'hwaterDn1',
    width: 85
  },
  {
    title: '热水温度预减2(℃)',
    align: "center",
    dataIndex: 'hwaterDn2',
    width: 85
  },
  {
    title: '萃取温度设置(℃)',
    align: "center",
    dataIndex: 'leachTem',
    width: 75
  },
  {
    title: '蒸发温度设置(℃)',
    align: "center",
    dataIndex: 'vapTem',
    width: 75
  },
  {
    title: '空气罐压力设置(kPa)',
    align: "center",
    dataIndex: 'airPre',
    width: 90
  },
  {
    title: '萃取器脱溶时间(s)',
    align: "center",
    dataIndex: 'leachDst',
    width: 80
  },
  {
    title: '过滤器脱溶时间设置(s)',
    align: "center",
    dataIndex: 'filterDst',
    width: 95
  },
  {
    title: '真空脱溶时间设置(s)',
    align: "center",
    dataIndex: 'vacuoDst',
    width: 90
  },
  {
    title: '冷水温度设置(℃)',
    align: "center",
    dataIndex: 'cwaterSt',
    width: 75
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "工艺名称",
    field: 'craftName',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '工艺名称',
    field: 'craftName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入工艺名称!'},
             ];
    },
  },
  {
    label: '萃取次数设置',
    field: 'leachTs',
    component: 'InputNumber',
  },
  {
    label: '计量设定时间(s)',
    field: 'meterSt',
    component: 'InputNumber',
  },
  {
    label: '计量延迟时间(s)',
    field: 'meterDt',
    component: 'InputNumber',
  },
  {
    label: '萃取进液设定时间(s)',
    field: 'intakeSt',
    component: 'InputNumber',
  },
  {
    label: '萃取出液设定时间(s)',
    field: 'leachSt',
    component: 'InputNumber',
  },
  {
    label: '萃取出液延迟蒸发时间(s)',
    field: 'vapDt',
    component: 'InputNumber',
  },
  {
    label: '浸泡设定时间(s)',
    field: 'dipinSt',
    component: 'InputNumber',
  },
  {
    label: '延迟时间设置(s)',
    field: 'delaySt',
    component: 'InputNumber',
  },
  {
    label: '真空计量时间设置(s)',
    field: 'vacuoMst',
    component: 'InputNumber',
  },
  {
    label: '真空压力设置(kPa)',
    field: 'vacuoPre',
    component: 'InputNumber',
  },
  {
    label: '压机压力设置(kPa)',
    field: 'comprPre',
    component: 'InputNumber',
  },
  {
    label: '热水温度设置(℃)',
    field: 'hwaterTem',
    component: 'InputNumber',
  },
  {
    label: '热水温度预减1(℃)',
    field: 'hwaterDn1',
    component: 'InputNumber',
  },
  {
    label: '热水温度预减2(℃)',
    field: 'hwaterDn2',
    component: 'InputNumber',
  },
  {
    label: '萃取温度设置(℃)',
    field: 'leachTem',
    component: 'InputNumber',
  },
  {
    label: '蒸发温度设置(℃)',
    field: 'vapTem',
    component: 'InputNumber',
  },
  {
    label: '空气罐压力设置(kPa)',
    field: 'airPre',
    component: 'InputNumber',
  },
  {
    label: '萃取器脱溶时间(s)',
    field: 'leachDst',
    component: 'InputNumber',
  },
  {
    label: '过滤器脱溶时间设置(s)',
    field: 'filterDst',
    component: 'InputNumber',
  },
  {
    label: '真空脱溶时间设置(s)',
    field: 'vacuoDst',
    component: 'InputNumber',
  },
  {
    label: '冷水温度设置(℃)',
    field: 'cwaterSt',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
